﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.EquipmentManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.EquipmentManagement.EquipmentTagVMs
{
    public partial class EquipmentTagTemplateVM : BaseTemplateVM
    {
        [Display(Name = "_Model._EquipmentTag._Equipment")]
        public ExcelPropety Equipment_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.EquipmentId);
        [Display(Name = "_Model._EquipmentTag._DriverType")]
        public ExcelPropety DriverType_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.DriverType);

        [Display(Name = "_Model._EquipmentTag._TagName")]
        public ExcelPropety TagName_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.TagName);
        [Display(Name = "_Model._EquipmentTag._Address")]
        public ExcelPropety Address_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.Address);
       
        //[Display(Name = "_Model._EquipmentTag._Description")]
        //public ExcelPropety Description_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.Description);
        [Display(Name = "_Model._EquipmentTag._TagType")]
        public ExcelPropety TagType_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.TagType);
       
        [Display(Name = "_Model._EquipmentTag._GroupType")]
        public ExcelPropety GroupType_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.GroupType);

        [Display(Name = "_Model._EquipmentTag._DataType")]
        public ExcelPropety DataType_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.DataType);

        [Display(Name = "_Model._EquipmentTag._AccessMode")]
        public ExcelPropety AccessMode_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.AccessMode);
        //[Display(Name = "_Model._EquipmentTag._Aux_1")]
        //public ExcelPropety Aux_1_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.Aux_1);
        //[Display(Name = "_Model._EquipmentTag._Aux_2")]
        //public ExcelPropety Aux_2_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.Aux_2);
        [Display(Name = "_Model._EquipmentTag._ScanRate")]
        public ExcelPropety ScanRate_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.ScanRate);
        [Display(Name = "_Model._EquipmentTag._Active")]
        public ExcelPropety Active_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.Active);
       
        [Display(Name = "_Model._EquipmentTag._UpLimit")]
        public ExcelPropety UpLimit_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.UpLimit);
        [Display(Name = "_Model._EquipmentTag._LowerLimit")]
        public ExcelPropety LowerLimit_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.LowerLimit);
        [Display(Name = "_Model._EquipmentTag._ActiveLimit")]
        public ExcelPropety ActiveLimit_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.ActiveLimit);
        //[Display(Name = "_Model._EquipmentTag._EquipCode")]
        //public ExcelPropety EquipCode_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.EquipCode);
        //[Display(Name = "_Model._EquipmentTag._CreateTime")]
        //public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.CreateTime, true);
        //[Display(Name = "_Model._EquipmentTag._UpdateTime")]
        //public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.UpdateTime, true);
        //[Display(Name = "_Model._EquipmentTag._CreateBy")]
        //public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.CreateBy);
        //[Display(Name = "_Model._EquipmentTag._UpdateBy")]
        //public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.UpdateBy);
        //[Display(Name = "_Model._EquipmentTag._IsValid")]
        //public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.IsValid);
        //[Display(Name = "_Model._EquipmentTag._TenantCode")]
        //public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<EquipmentTag>(x => x.TenantCode);

	    protected override void InitVM()
        {
           
            Equipment_Excel.DataType = ColumnDataType.ComboBox;
            Equipment_Excel.ListItems = DC.Set<Equipment>().GetSelectListItems(Wtm, y => y.EquipName);

        }

    }

    public class EquipmentTagImportVM : BaseImportVM<EquipmentTagTemplateVM, EquipmentTag>
    {
            //import

    }

}